<!-- 同行比较 -->
<template>
  <div class="comparison">
    <!-- 公司规模 -->
    <yn-com-comTitle name="公司规模"></yn-com-comTitle>
    <yn-comparison-scale :data="scale" @update="getData"></yn-comparison-scale>
    <!-- 估值水平 -->
    <yn-com-comTitle class="mt15" name="估值水平"></yn-com-comTitle>
    <yn-comparison-valuation :data="valuation" @update="getData"></yn-comparison-valuation>
    <!-- 市场表现 -->
    <yn-com-comTitle class="mt15" name="市场表现"></yn-com-comTitle>
    <yn-comparison-effect :data="effect" @update="getData"></yn-comparison-effect>
  </div>
</template>

<script>
import { comparison } from "../script/api";
export default {
  data() {
    return {
      effect: [], //市场表现
      scale: [], //公司规模
      valuation: [] //估值水平
    };
  },
  components: {},
  computed: {},
  mounted() {
    this.comparison();
  },
  methods: {
    async comparison() {
      const res = await comparison();
      this.effect = res.effect;
      this.scale = res.scale;
      this.valuation = res.valuation;
    },
    async getData(ops) {
      const res = await comparison(ops);
      if (ops.method == "valuation") {
        this.valuation = res.valuation;
      }
      if (ops.method == "scale") {
        this.scale = res.scale;
      }
      if (ops.method == "effect") {
        this.effect = res.effect;
      }
    }
  }
};
</script>
<style lang='scss' scoped>
</style>